module.exports = app => {
  const { STRING, INTEGER, DATE, Sequelize } = app.Sequelize;
  return app.model.define(
    'account',
    {
      account_id: { type: INTEGER, primaryKey: true, autoIncrement: true },
      account_name: { type: STRING },
      password: { type: STRING },
      sex: { type: INTEGER, defaultValue: 0 },
      email: { type: STRING },
      mobile: { type: STRING },
      avatar: { type: STRING },
      signature: { type: STRING },
      tencent_qq: { type: STRING },
      introduce: { type: STRING },
      hometown: { type: STRING },
      current_residence: { type: STRING },
      create_time: {
        type: DATE,
        defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
      },
      update_time: {
        type: DATE,
        defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
      },
    },
    {
      freezeTableName: true,
      timestamps: false,
      underscored: true,
    },
  );
};
